#ifndef __IP_CAN_FIFO_H__
#define __IP_CAN_FIFO_H__

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "xil_io.h"


#define AXIS_FIFO_ISR   (0x0)
#define AXIS_FIFO_IER   (0x4)
#define AXIS_FIFO_TDFR  (0x8)
#define AXIS_FIFO_TDFV  (0xc)

#define AXIS_FIFO_TDFD  (0x10)
#define AXIS_FIFO_TLR   (0x14)
#define AXIS_FIFO_RDFR  (0x18)
#define AXIS_FIFO_RDFO  (0x1c)
#define AXIS_FIFO_RDFD  (0x20)
#define AXIS_FIFO_RLR   (0x24)
#define AXIS_FIFO_SRR   (0x28)


#define AXIS_FIFO_BASEADDRESS (0x00500000)

#define CONFIG_FIFO_BASEADDRESS (0x44A00000)

void axis_fifo_reset(UINTPTR BaseAddress);
unsigned int axis_fifo_read_data_len(UINTPTR BaseAddress);
int axis_fifo_read_data(UINTPTR BaseAddress, unsigned char *buffer, int length);
int axis_fifo_write_data(UINTPTR BaseAddress, unsigned char *buffer, int length);


// typedef struct
// {
//		volatile unsigned int ISR;
//		volatile unsigned int IER;
//		volatile unsigned int TDFR;
//		volatile unsigned int TDFV;
//		volatile unsigned int TDFD;
//		volatile unsigned int TLR;
//		volatile unsigned int RDFR;
//		volatile unsigned int RDFO;
//		volatile unsigned int RDFD;
//		volatile unsigned int RLR;
//		volatile unsigned int SRR;
// }drv_axis_fifo_reg_t;
// void axis_fifo_reset(drv_axis_fifo_reg_t *reg);
// unsigned int axis_fifo_read_data_len(drv_axis_fifo_reg_t *reg);
// int axis_fifo_read_data(drv_axis_fifo_reg_t *reg, unsigned char *buffer, int length);
// int axis_fifo_write_data(drv_axis_fifo_reg_t *reg, unsigned int *buffer, int length);

#endif

